<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>折线图</title>
		<script type="text/javascript" src="js/echarts.js" ></script>
		
	</head>
	<body>
		<div id="sales"  style="width: 600px;height: 500px;">
			
		</div>
		<script>
			myCharts=echarts.init(document.getElementById("sales"));
			var option={
				title:{
					text:'一周的销量变化曲线',
					subtext:'2022年第20周',
					left:'center'
				},
				xAxis:{
					type:'category',
					data:['周一','周二','周三','周四','周五']
					
				},
				yAxis:{
					type:'value'
					
				},
				legend:{//图例
					data:['鼠标的销量','水杯的销量'],
					left:'right'
				},
				series:[
					{
						name:'鼠标的销量',
						data:[200,350,500,180,700],
						type:'line',//折线图
						//smooth:true//变得圆滑
					},
					{
						name:'水杯的销量',
						data:[210,350,600,180,700],
						type:'line',//折线图
						//smooth:true//变得圆滑
					}
				]
				
				
			};
			myCharts.setOption(option);
			
		</script>
	</body>
</html>
